ig.module(
	'game.entities.replayButton'
)
.requires(
	'impact.entity',
        'game.entities.base.baseButton',
        'game.entities.playButton'        
)
.defines(function()
{
    EntityReplayButton = EntityBaseButton.extend(
    {
        normalButton: new ig.Image("media/images/play.png"),
        overButton: new ig.Image("media/images/playOver.png"),
	
	init: function(x, y, settings)
	{
	    this.parent(x, y, settings);	    
	},
	
        onClick: function()
        {
            this.parent();
            
            ig.global.paused = false;
            ig.global.started = true;
            
            ig.global.failed = false;
            ig.global.paused = false;
            ig.global.numberOfPicks = 0;            
                
	    ig.global.started = false;
	    ig.global.justStarted = false;
	    ig.global.finished = false;
	    ig.global.justFinished = false;         
            this.kill();
            
            ig.global.reloadLevel = true;
            var replay = ig.game.getEntitiesByType(EntityPlayButton);
            replay[0].kill();
        }        
    });
});